package com.hujesse.TestVersion;

import com.hujesse.mapper.SureMapper;
import com.hujesse.pojo.Sure;
import org.springframework.beans.factory.annotation.Autowired;

// 这个类是和test包下的同名单元测试测试“同时修改多个数据，乐观锁是否生效”
public class ConcurrentUpdateTestVersion extends Thread {
    @Autowired
    private SureMapper sureMapper;
    @Override
    public void run() {
        Sure sure = sureMapper.selectById(1);
        sure.setUsername("多线程修改数据");
        sureMapper.updateById(sure);
    }
}
